<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:pe="http://primefaces.org/ui/extensions"
      xmlns:hr="http://java.sun.com/jsf/composite/autocomplete">

    <h:body>

        <ui:composition template="/resources/template/template.xhtml">

            <ui:define name="content">
                <h:form >
                    <p:panel >
                        <f:facet name="header" >
                            <h:outputLabel value="Attendance Report Late In" />
                        </f:facet>
                        <h:panelGrid columns="2" >
                            <h:outputLabel value="From : " />
                            <p:calendar value="#{hrReportController.fromDate}" pattern="dd MMMM yyyy hh:mm:ss a" />
                            <h:outputLabel value="To : " />
                            <p:calendar value="#{hrReportController.toDate}" pattern="dd MMMM yyyy hh:mm:ss a" />
                            <h:outputLabel value="Employee : "/>
                            <hr:completeStaff value="#{hrReportController.reportKeyWord.staff}"/>
                            <h:outputLabel value="Department : "/>
                            <hr:department value="#{hrReportController.reportKeyWord.department}"/>
                            <h:outputLabel value="Staff Category : "/>
                            <hr:completeStaffCategory value="#{hrReportController.reportKeyWord.staffCategory}"/>
                            <h:outputLabel value="Designation : "/>
                            <hr:completeDesignation value="#{hrReportController.reportKeyWord.designation}"/>
                            <h:outputLabel value="Roster : "/>
                            <hr:completeRoster value="#{hrReportController.reportKeyWord.roster}"/>
                            <h:outputLabel value="Shift : "/>
                            <hr:completeShift value="#{hrReportController.reportKeyWord.shift}"/>
                        </h:panelGrid>

                        <p:commandButton ajax="false" value="Process" action="#{hrReportController.createStaffShiftLateIn()}"/>
                        <p:commandButton ajax="false" value="Excel" styleClass="noPrintButton" onclick="onSubmitButton();" >
                            <pe:exporter type="xlsx" target="tb1" fileName="hr_report_attendance"  />
                        </p:commandButton>
                        <p:commandButton value="Print" ajax="false" action="#" >
                            <p:printer target="gpBillPreview" ></p:printer>
                        </p:commandButton>
                        <p:panel id="gpBillPreview" >                     
                            <p:dataTable id="tb1" value="#{hrReportController.staffShifts}" var="ss">
                                <p:column headerText="ID">
                                    #{ss.id}
                                </p:column>
                                <p:column headerText="Emp No">
                                    #{ss.staff.code}
                                </p:column>
                                <p:column headerText="Emp Name">
                                    #{ss.staff.person.nameWithTitle}
                                </p:column>
                                <p:column headerText="Roster Name">
                                    #{ss.staff.roster.name}
                                </p:column>                               
                                <p:column headerText="In Checked ">
                                    <h:outputLabel value="#{ss.startRecord.recordTimeStamp}">
                                        <f:convertDateTime pattern="dd/MM/yy hh:mm:ss a"/>
                                    </h:outputLabel>                                     
                                </p:column>   
                                <p:column headerText="Leave Type">
                                    <h:outputLabel value="#{ss.leaveType}"/>
                                </p:column>
                                <p:column headerText="Considered For Late In">
                                    <h:outputLabel value="#{ss.considerForLateIn}">                                        
                                    </h:outputLabel>                                     
                                </p:column>                                   
                                  <p:column headerText="Considered For Early Out">
                                      <h:outputLabel value="#{ss.considerForEarlyOut}">                                        
                                    </h:outputLabel>                                     
                                </p:column>                                   
                                <p:column headerText="Reference Staff Shift">
                                    <h:outputLabel value="#{ss.referenceStaffShiftLateIn.shiftDate}">                                        
                                    </h:outputLabel>                                     
                                </p:column> 

                                <p:column headerText="Late In Minute Varified">
                                    <h:outputLabel value="#{ss.lateInVarified}">                                        
                                        <f:converter converterId="longToTime"/>
                                    </h:outputLabel>
                                </p:column>   
                                <p:column headerText="Late In Minute Logged">
                                    <h:outputLabel value="#{ss.lateInLogged}">                                        
                                        <f:converter converterId="longToTime"/>
                                    </h:outputLabel>
                                </p:column>   
                            </p:dataTable>
                        </p:panel>


                    </p:panel>

                </h:form>
            </ui:define>

        </ui:composition>

    </h:body>
</html>
